home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
c_lang
/
tccurses.lzh
/
WINERASE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1987-09-07
|
2KB
|
55 lines
/****************************************************************/
/* */
/* Erase() routines of the PCcurses package */
/* */
/****************************************************************/
/* This version of curses is based on ncurses, a curses version */
/* originally written by Pavel Curtis at Cornell University. */
/* I have made substantial changes to make it run on IBM PC's, */
/* and therefore consider myself free to make it public domain. */
/* Bjorn Larsson (...mcvax!enea!infovax!bl) */
/****************************************************************/
/* 1.0: Release: 870515 */
/****************************************************************/
#include <curses.h>
#include <curspriv.h>
/****************************************************************/
/* Werase() fills all lines of window 'win' with blanks and po- */
/* sitions the cursor at home in the scroll region. */
/****************************************************************/
void werase(win)
WINDOW *win;
{
int *end;
int *start;
short y;
static int blank;
blank = ' ' | (win->_attrs & ATR_MSK);
for (y = win->_regtop; y <= win->_regbottom; y++) /* clear all lines */
{
start = win->_line[y];
end = &start[win->_maxx];
while (start <= end) /* clear all line */
*start++ = blank;
win->_minchng[y] = 0;
win->_maxchng[y] = win->_maxx;
}
win->_cury = win->_regtop; /* cursor home */
win->_curx = 0;
} /* werase */
/****************************************************************/
/* Erase() fills all lines of stdscr with blanks and positions */
/* the cursor at home in the scroll region. */
/****************************************************************/
void erase()
{
werase(stdscr);
} /* erase */